﻿<UserControl x:Class="Big3.Hitbase.MainControls.PlayerUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:misc="clr-namespace:Big3.Hitbase.Miscellaneous;assembly=Misc"
             xmlns:local="clr-namespace:Big3.Hitbase.MainControls"
             xmlns:trans="clr-namespace:Transitionals;assembly=Transitionals"
             xmlns:transc="clr-namespace:Transitionals.Controls;assembly=Transitionals"
             xmlns:transt="clr-namespace:Transitionals.Transitions;assembly=Transitionals"
             xmlns:sr="clr-namespace:Big3.Hitbase.SharedResources;assembly=Big3.Hitbase.SharedResources"
             xmlns:controls="clr-namespace:Big3.Hitbase.Controls;assembly=Controls"
             mc:Ignorable="d" Name="PlayerControl"
             >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Controls;component/SplitButtonStyle.xaml" ></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>

            <local:RepeatTypeCheckedConverter x:Key="repeatTypeCheckedConverter" />
        <misc:LengthConverter x:Key="lengthConverter" />
        <Path x:Key="PlayPath" Fill="#CFFFFFFF" Stroke="#80000000" Data="M 10 0 L 40 20 L 10 40 L 10 0" ></Path>
        <Path x:Key="PausePath" Fill="#CFFFFFFF" Stroke="#80000000" Data="M 0 0 L 10 0 L 10 40 L 0 40 M 20 0 L 30 0 L 30 40 L 20 40" ></Path>
        <Path x:Key="StopPath" Fill="#CFFFFFFF" Stroke="#80000000" Data="M 0,0 L 10,0 L 10,10 L 0, 10" />

        <Path x:Key="NextTrackPath" Fill="#CFFFFFFF" Stroke="#80000000" Data="M 0 0 L 10 8 L 0,16  M 10,0 L 20,8 L 10,16 M 20,0 L 25,0 L 25,16 L 20,16" />

        <Path x:Key="PrevTrackPath" Fill="#CFFFFFFF" Stroke="#80000000" Data="M 25 0 L 15 8 L 25,16  M 15,0 L 5,8 L 15,16 M 5,0 L 0,0 L 0,16 L 5,16" />


        <PathGeometry x:Key="NextTrackButtonPath" Figures="M0,0 L50,0 C50,0 60,10 60,20  
										C60,20 60,30 50,40 L0,40
										C0,40 6,30 6,20 
										C6,20 6,10 0,0 z">
           
        </PathGeometry>

        <PathGeometry x:Key="PrevTrackButtonPath" Figures="M60,0 L10,0 C10,0 0,10 0,20  
										C0,20 0,30 10,40 L60,40
										C60,40 54,30 54,20 
										C54,20 54,10 60,0 z">

        </PathGeometry>


        <LinearGradientBrush x:Key="ToggleButtonBackgroundChecked" EndPoint="0.504,1.5" StartPoint="0.504,0.03">
            <GradientStop Color="#FFFFC934" Offset="0"/>
            <GradientStop Color="#FFFFFFFF" Offset="0.567"/>
        </LinearGradientBrush>

        <Style TargetType="{x:Type ToggleButton}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <Grid x:Name="mainGrid" Margin="1,1,1,1">
                            <Grid x:Name="uncheckedState">
                                <Border Name="uncheckedStateBorder" Margin="0,0,0,0" BorderBrush="BlanchedAlmond" BorderThickness="0" CornerRadius="4,4,4,4"
                                        Background="Transparent">
                                    <ContentControl HorizontalAlignment="Center" VerticalAlignment="Center"></ContentControl>
                                </Border>
                            </Grid>
                            <Grid x:Name="checkedState" Visibility="Collapsed" >
                                <Border Margin="0,0,0,0" BorderBrush="BlanchedAlmond" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4"
                                        Background="{StaticResource ToggleButtonBackgroundChecked}">
                                    <ContentControl HorizontalAlignment="Center" VerticalAlignment="Center"></ContentControl>
                                    <!--ContentControl HorizontalAlignment="Center" VerticalAlignment="Center">Sampler √</ContentControl-->
                                </Border>
                            </Grid>
                            <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" />
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="uncheckedStateBorder" Property="Background" Value="{StaticResource ToggleButtonBackgroundChecked}"></Setter>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="True">
                                <Setter TargetName="checkedState" Property="Visibility" Value="Visible" />
                                <Setter TargetName="uncheckedState" Property="Visibility" Value="Collapsed" />
                                <Setter Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect ShadowDepth="0" Color="Orange" BlurRadius="10" />
                                    </Setter.Value>
                                </Setter>

                                <!--Setter TargetName="mainGrid" Property="Margin" Value="2,2,0,0"/-->
                                <!--Setter TargetName="checkedState" Property="Background" Value="Blue" /-->
                                <!--Setter TargetName="uncheckedState" Property="Background" Value="Red" /-->
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="NextTrackGlassButton" TargetType="{x:Type Button}">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <!-- Background Layer -->
                            <Path Data="{StaticResource NextTrackButtonPath}"  Fill="{TemplateBinding Background}" Stroke="White" StrokeThickness="2" />
                            <Path Data="{StaticResource NextTrackButtonPath}" Stroke="Black" StrokeThickness="1" />
                            <!-- Refraction Layer -->
                            <Path Data="{StaticResource NextTrackButtonPath}" x:Name="RefractionLayer" Margin="1">
                                <Path.Fill>
                                    <RadialGradientBrush GradientOrigin="0.496,1.052">
                                        <RadialGradientBrush.RelativeTransform>
                                            <TransformGroup>
                                                <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.5" ScaleY="1.5"/>
                                                <TranslateTransform X="0.02" Y="0.3"/>
                                            </TransformGroup>
                                        </RadialGradientBrush.RelativeTransform>
                                        <GradientStop Offset="1" Color="#00000000"/>
                                        <GradientStop Offset="0.4" Color="#FF48CBFA"/>
                                    </RadialGradientBrush>
                                </Path.Fill>
                            </Path>
                            
                            <!-- Reflection Layer -->
                            <Path Data="{StaticResource NextTrackButtonPath}" x:Name="ReflectionLayer" Margin="1">
                                <Path.Fill>
                                    <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                                        <GradientStop Offset="1" Color="#FFAFFFFF"/>
                                        <GradientStop Offset="0.85" Color="#9248CBFA"/>
                                        <GradientStop Offset="0.5" Color="#0077A1D0"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                            <!-- ContentPresenter -->
                            <ContentPresenter Margin="0,2,0,0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="RefractionLayer" Property="Fill">
                                    <Setter.Value>
                                        <RadialGradientBrush GradientOrigin="0.496,1.052">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform
                                          CenterX="0.5"
                                          CenterY="0.5"
                                          ScaleX="1.5"
                                          ScaleY="1.5"/>
                                                    <TranslateTransform X="0.02" Y="0.3"/>
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop Offset="1" Color="#00000000"/>
                                            <GradientStop Offset="0.45" Color="#FFFFFFFF"/>
                                        </RadialGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter TargetName="ReflectionLayer" Property="Fill">
                                    <Setter.Value>
                                        <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                                            <GradientStop Offset="1" Color="#FFFFFFFF"/>
                                            <GradientStop Offset="0.85" Color="#BBFFFFFF"/>
                                            <GradientStop Offset="0.5" Color="#00000000"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter TargetName="RefractionLayer" Property="Fill">
                                    <Setter.Value>
                                        <RadialGradientBrush GradientOrigin="0.496,1.052">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform
                                          CenterX="0.5"
                                          CenterY="0.5"
                                          ScaleX="1.5"
                                          ScaleY="1.5"/>
                                                    <TranslateTransform X="0.02" Y="0.3"/>
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop Offset="1" Color="#00000000"/>
                                            <GradientStop Offset="0.3" Color="#FFFFFFFF"/>
                                        </RadialGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter TargetName="ReflectionLayer" Property="Fill">
                                    <Setter.Value>
                                        <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                                            <GradientStop Offset="1" Color="#CCFFFFFF"/>
                                            <GradientStop Offset="0.85" Color="#66FFFFFF"/>
                                            <GradientStop Offset="0.5" Color="#00000000"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="PrevTrackGlassButton" TargetType="{x:Type Button}">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <!-- Background Layer -->
                            <Path Data="{StaticResource PrevTrackButtonPath}"  Fill="{TemplateBinding Background}" Stroke="White" StrokeThickness="2" />
                            <Path Data="{StaticResource PrevTrackButtonPath}" Stroke="Black" StrokeThickness="1" />
                            <!-- Refraction Layer -->
                            <Path Data="{StaticResource PrevTrackButtonPath}" x:Name="RefractionLayer" Margin="1">
                                <Path.Fill>
                                    <RadialGradientBrush GradientOrigin="0.496,1.052">
                                        <RadialGradientBrush.RelativeTransform>
                                            <TransformGroup>
                                                <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.5" ScaleY="1.5"/>
                                                <TranslateTransform X="0.02" Y="0.3"/>
                                            </TransformGroup>
                                        </RadialGradientBrush.RelativeTransform>
                                        <GradientStop Offset="1" Color="#00000000"/>
                                        <GradientStop Offset="0.4" Color="#FF48CBFA"/>
                                    </RadialGradientBrush>
                                </Path.Fill>
                            </Path>

                            <!-- Reflection Layer -->
                            <Path Data="{StaticResource PrevTrackButtonPath}" x:Name="ReflectionLayer" Margin="1">
                                <Path.Fill>
                                    <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                                        <GradientStop Offset="1" Color="#FFAFFFFF"/>
                                        <GradientStop Offset="0.85" Color="#9248CBFA"/>
                                        <GradientStop Offset="0.5" Color="#0077A1D0"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                            <!-- ContentPresenter -->
                            <ContentPresenter Margin="0,2,0,0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="RefractionLayer" Property="Fill">
                                    <Setter.Value>
                                        <RadialGradientBrush GradientOrigin="0.496,1.052">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform
                                          CenterX="0.5"
                                          CenterY="0.5"
                                          ScaleX="1.5"
                                          ScaleY="1.5"/>
                                                    <TranslateTransform X="0.02" Y="0.3"/>
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop Offset="1" Color="#00000000"/>
                                            <GradientStop Offset="0.45" Color="#FFFFFFFF"/>
                                        </RadialGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter TargetName="ReflectionLayer" Property="Fill">
                                    <Setter.Value>
                                        <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                                            <GradientStop Offset="1" Color="#FFFFFFFF"/>
                                            <GradientStop Offset="0.85" Color="#BBFFFFFF"/>
                                            <GradientStop Offset="0.5" Color="#00000000"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter TargetName="RefractionLayer" Property="Fill">
                                    <Setter.Value>
                                        <RadialGradientBrush GradientOrigin="0.496,1.052">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform
                                          CenterX="0.5"
                                          CenterY="0.5"
                                          ScaleX="1.5"
                                          ScaleY="1.5"/>
                                                    <TranslateTransform X="0.02" Y="0.3"/>
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop Offset="1" Color="#00000000"/>
                                            <GradientStop Offset="0.3" Color="#FFFFFFFF"/>
                                        </RadialGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter TargetName="ReflectionLayer" Property="Fill">
                                    <Setter.Value>
                                        <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                                            <GradientStop Offset="1" Color="#CCFFFFFF"/>
                                            <GradientStop Offset="0.85" Color="#66FFFFFF"/>
                                            <GradientStop Offset="0.5" Color="#00000000"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        </ResourceDictionary>

    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <transc:TransitionElement x:Name="TrackDetailTransitionBox" Grid.Row="0">
            <transc:TransitionElement.Transition>
                <transt:FadeAndBlurTransition/>
            </transc:TransitionElement.Transition>
        </transc:TransitionElement>


        <StackPanel Orientation="Horizontal" Grid.Column="1">
            <Grid>
                <Path Fill="#66FFFFFF" Stroke="LightGray" Height="85" Data="M255,0.5 C268.20306,0.49999905 279.99994,6.4497147 287.79507,15.7841 L287.96674,15.999999 306,15.999999 483,15.999999 C497.63556,15.999999 509.5,27.864453 509.5,42.499999 509.5,57.135547 497.63556,68.999999 483,68.999999 L287.96674,68.999999 287.79507,69.215899 C279.99994,78.550284 268.20306,84.499999 255,84.499999 241.79694,84.499999 230.00006,78.550284 222.20494,69.215899 L222.03325,68.999999 27,68.999999 C12.364454,68.999999 0.5,57.135547 0.5,42.499999 0.5,27.864453 12.364454,15.999999 27,15.999999 L222.03325,15.999999 222.20494,15.7841 C230.00006,6.4497147 241.79694,0.49999905 255,0.5 z"/>
                <ToggleButton Name="ToggleButtonShuffle" VerticalAlignment="Center" HorizontalAlignment="Left" Width="30" Height="30" Margin="30,0,0,0" ToolTip="{sr:Loc ShuffleOn}" IsChecked="{Binding ShuffleActive}" Checked="ToggleButtonShuffle_Checked">
                    <Image Width="16" Height="16" Source="pack://application:,,,/Big3.Hitbase.SharedResources;component/Images/Shuffle.png" />
                </ToggleButton>
                <ToggleButton Name="ToggleButtonRepeat" VerticalAlignment="Center" HorizontalAlignment="Left" Width="30" Height="30" Margin="70,0,0,0" ToolTip="{sr:Loc RepeatSingle}" IsChecked="{Binding RepeatType, Converter={StaticResource repeatTypeCheckedConverter}, Mode=OneWay}" Click="ToggleButtonRepeat_Click" >
                    <Image Width="16" Height="16" Source="pack://application:,,,/Big3.Hitbase.SharedResources;component/Images/Repeat.png" Name="ImageRepeat" />
                </ToggleButton>
                <Button Background="#345BA0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="30" Height="30" Margin="120,0,0,0" Name="ButtonStop" Click="ButtonStop_Click" Style="{StaticResource RoundGlassButton}"
                        Content="{StaticResource StopPath}" ToolTip="{sr:Loc Stop}">
                </Button>
                <Button Background="#345BA0" Name="ButtonPlayPrev" VerticalAlignment="Center" HorizontalAlignment="Left" Width="62" Height="40" Margin="158,0,0,0" Click="ButtonPlayPrev_Click" Style="{StaticResource PrevTrackGlassButton}"
                        Content="{StaticResource PrevTrackPath}" ToolTip="{sr:Loc PrevTrackAndSeek}"
                        PreviewMouseDown="ButtonPlayPrev_PreviewMouseDown" PreviewMouseUp="ButtonPlayPrev_PreviewMouseUp">
                </Button>
                <Button Background="#345BA0" Style="{StaticResource RoundGlassButton}" HorizontalAlignment="Center" Width="75" Height="75" Name="ButtonPlay" Command="sr:HitbaseCommands.Play" Content="{StaticResource PlayPath}"
                        ToolTip="{sr:Loc Play}">
                    
                </Button>
                <Button Background="#345BA0"  Name="ButtonPlayNext" VerticalAlignment="Center" HorizontalAlignment="Right" Width="60" Height="40" Margin="0,0,157.2,0" Click="ButtonPlayNext_Click" Style="{StaticResource NextTrackGlassButton}" PreviewMouseDown="ButtonPlayNext_PreviewMouseDown" PreviewMouseUp="ButtonPlayNext_PreviewMouseUp"
                        Content="{StaticResource NextTrackPath}" ToolTip="{sr:Loc NextTrackAndSeek}">
                </Button>
                <ToggleButton VerticalAlignment="Center" HorizontalAlignment="Right" Width="30" Height="30" Margin="0,0,100,0" Name="ButtonMute" Click="ButtonMute_Click" ToolTip="{sr:Loc VolumeOff}">
                    <Image Width="16" Name="ImageMute" Source="pack://application:,,,/Big3.Hitbase.SharedResources;component/Images/Sound.png" />
                </ToggleButton>
                <!--<Path VerticalAlignment="Center" HorizontalAlignment="Right" Width="70" Margin="0,0,15,0" Data="M0,30 L80,0 L80,30 L0,30" Stretch="Fill" Height="20" Fill="#20000000" />-->
                <Slider VerticalAlignment="Center" HorizontalAlignment="Right" Width="80" Margin="0,0,10,0" ValueChanged="Slider_ValueChanged" 
                        Name="SliderVolume" Minimum="0" Maximum="10" ToolTip="{sr:Loc Volume}"></Slider>
            </Grid>
        </StackPanel>
        <local:WaveDataUserControl HorizontalAlignment="Center" Width="507" Grid.Column="0" IsHitTestVisible="False" Grid.ColumnSpan="3" Opacity="0.5" x:Name="WaveDataUserControl" Height="40" VerticalAlignment="Bottom"></local:WaveDataUserControl>

        <local:LyricsUserControl HorizontalAlignment="Right" Margin="20,0,0,0" Grid.Column="2" Playlist="{Binding Playlist, ElementName=PlayerControl}"  PlaylistItem="{Binding Playlist.CurrentPlaylistItem, ElementName=PlayerControl}"  Grid.ColumnSpan="3" Opacity="0.5" x:Name="LyricsUserControl" />

        <!--<controls:SplitButton Margin="0,0,2,2" Grid.Column="2" HorizontalAlignment="Right" Name="splitButtonView" VerticalAlignment="Center" Height="22"
                              Image="pack://application:,,,/Big3.Hitbase.SharedResources;component/Images/View.png" Click="splitButtonView_Click"
                              Style="{StaticResource ToolBarSplitButtonStyle}">
            <controls:SplitButton.DropDownContextMenu>
                <ContextMenu>
                    <MenuItem Header="Signal" Name="MenuItemSignal" Click="MenuItemSignal_Click"  />
                    <MenuItem Header="Frequenzband" Name="MenuItemFrequencyBand" Click="MenuItemFrequencyBand_Click" />
                    <MenuItem Header="Liedtext (Lyrics)" Name="MenuItemLyrics" Click="MenuItemLyrics_Click" />
                    <MenuItem Header="Aus" Name="MenuItemOff" Click="MenuItemOff_Click" />
                </ContextMenu>
            </controls:SplitButton.DropDownContextMenu>
        </controls:SplitButton>-->

    </Grid>
</UserControl>
